#ifndef REMIADDDIALOG_H
#define REMIADDDIALOG_H

#include <QtGui>
#include <QtNetwork>
#include <QtWebKit>
#include "rt.h"
#include "decipheraddon.h"

namespace Ui {
class RemiAddDialog;
}

class RemiAddDialog : public QDialog
{
    Q_OBJECT
    
public:
    explicit RemiAddDialog(QWidget *parent, QString *objektnr, QString *titel, QString gtin);
    ~RemiAddDialog();
    
protected:
    bool event(QEvent *e);
    bool eventFilter(QObject *object, QEvent *event);
    void moveEvent(QMoveEvent *);

private Q_SLOTS:
    void searchOnline();
    void searchReplyFinished();
    void on_titel_lineEdit_textEdited(const QString &string);
    void on_buttonBox_accepted();

private:
    Ui::RemiAddDialog *ui;
    DecipherAddon da;
    QFrame *search_popup;
    QListWidget *search_results;
    QTimer *search_timer;

    QNetworkReply *search_reply;

    QString current_objectnr;
    QString *objektnr;
    QString *titel;
    QString gtin;
};

#endif // REMIADDDIALOG_H
